{extend name="layout" /}
{block name="css"}<link rel="stylesheet" href="/static/style/admin.css" media="all">{/block}
{block name="title"}幻灯片管理{/block}
{block name="content"}
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-header layuiadmin-card-header-auto">
                <button class="layui-btn layuiadmin-btn-slide" data-type="add">添加</button>
            </div>
            <div class="layui-card-body">
                <table id="LAY-set-slide-list" lay-filter="LAY-set-slide-list"></table>
                <script type="text/html" id="statusTpl">
                    {{#  if(d.status){ }}
                    <button class="layui-btn layui-btn-xs">启用</button>
                    {{#  } else { }}
                    <button class="layui-btn layui-btn-primary layui-btn-xs">禁用</button>
                    {{#  } }}
                </script>
                <script type="text/html" id="LAY-set-slide-bar">
                    <a class="layui-btn layui-btn-xs" lay-event="item"><i
                            class="layui-icon layui-icon-list"></i>子项目</a>
                    <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
                            class="layui-icon layui-icon-edit"></i>编辑</a>
                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
                            class="layui-icon layui-icon-delete"></i>删除</a>
                </script>
            </div>
        </div>
    </div>
{/block}
{block name="js"}
<script>
    layui.use(['index', 'slide', 'table'], function(){
        var $ = layui.$, active = {
            add: function(){
                add('添加幻灯片', 'slide', '400px', '300px', 'LAY-set-slide');
            }
        }
        $('.layui-btn.layuiadmin-btn-slide').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
{/block}